package com.lidong.lowcode.database.entity.database;

import com.lidong.lowcode.database.constants.enumconst.StrCaseEnum;
import com.lidong.lowcode.database.constants.database.CharacterSetEnum;
import com.lidong.lowcode.database.constants.database.SqlColumnEnum;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 9/10/2022 10:34 AM
 */
public class DataBaseColumn {

    /**
     * 字段名称
     */
    private String name;
    /**
     * 列类型
     */
    private SqlColumnEnum dataType;
    /**
     * 非空
     */
    private boolean notNull;
    /**
     * 自增
     */
    private boolean autoIncrement;
    /**
     * 主键
     */
    private boolean isPrimaryKey;
    /**
     * 默认值
     */
    private Object defaultValue;
    /**
     * 字符集
     */
    private CharacterSetEnum character;
    /**
     * 长度
     */
    private int length;
    /**
     * 精度
     */
    private int decimalLength;
    /**
     * 字段大小写
     */
    private StrCaseEnum nameCase;
    /**
     * 备注
     */
    private String remark;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public SqlColumnEnum getDataType() {
        return dataType;
    }

    public void setDataType(SqlColumnEnum dataType) {
        this.dataType = dataType;
    }

    public boolean isNotNull() {
        return notNull;
    }

    public void setNotNull(boolean notNull) {
        this.notNull = notNull;
    }

    public boolean isAutoIncrement() {
        return autoIncrement;
    }

    public void setAutoIncrement(boolean autoIncrement) {
        this.autoIncrement = autoIncrement;
    }

    public boolean isPrimaryKey() {
        return isPrimaryKey;
    }

    public void setPrimaryKey(boolean primaryKey) {
        isPrimaryKey = primaryKey;
    }

    public Object getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(Object defaultValue) {
        this.defaultValue = defaultValue;
    }

    public CharacterSetEnum getCharacter() {
        return character;
    }

    public void setCharacter(CharacterSetEnum character) {
        this.character = character;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getDecimalLength() {
        return decimalLength;
    }

    public void setDecimalLength(int decimalLength) {
        this.decimalLength = decimalLength;
    }

    public StrCaseEnum getNameCase() {
        return nameCase;
    }

    public void setNameCase(StrCaseEnum nameCase) {
        this.nameCase = nameCase;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "Column{" +
                "name='" + name + '\'' +
                ", dataType=" + dataType +
                ", notNull=" + notNull +
                ", autoIncrement=" + autoIncrement +
                ", isPrimaryKey=" + isPrimaryKey +
                ", defaultValue=" + defaultValue +
                ", character=" + character +
                ", length=" + length +
                ", decimalLength=" + decimalLength +
                ", nameCase=" + nameCase +
                ", remark='" + remark + '\'' +
                '}';
    }
}
